package com.pym.bs.controller;

import com.pym.bs.domain.Demos;
import com.pym.bs.dto.DemosDTO;
import com.pym.bs.service.UploadService;
import com.pym.bs.vo.ResultVO;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.io.IOException;

@RestController
@RequestMapping(value = "/upload")
public class UploadController {

    @Resource
    private UploadService uploadService;

    @RequestMapping(value = "/add")
    public ResultVO<Demos> add(DemosDTO demosDTO) throws IOException {
        return uploadService.save(demosDTO);
    }
}
